<?php

	if(!class_exists('vmShipperPlugin')) require(JPATH_COMPONENT.DS.'helpers'.DS.'vmshipperplugin.php');
	$plgin = new vmShipperPlugin();
	$_shippers = $plgin->plgVmOnSelectShipper($this->_cart, $this->_cart->shipper_id);
//	echo ','. json_encode($_shippers);
?>
	"carriers" : [
<?php 
	$i=0;
	foreach ($_shippers as $val ) {
?>
 
		{
		"name" : <?php echo json_encode($val->name)?>, 
		"id" : <?php echo json_encode($val->id)?>, 
		"shipping_rate_name" : <?php echo json_encode($val->shipping_rate_name)?>,
		"shipping_rate_id" : <?php echo json_encode($val->shipping_rate_id)?>, 
		"shipping_rate" : <?php echo json_encode($val->shipping_rate)?>, 
		"checked" : <?php echo json_encode($val->checked)?>,
		"select_rate_id_url" : <?php echo json_encode(JURI::root() . 'index.php?option=com_mvm&task=cart.setshipping&shipper_id=' .$val->id .'&view=cart&format=json')?>
		
		}<?php $i++; if ($i < count($_shippers)) echo",";
	}
?>	
	]
